<p><label for='pages_title'><span style='color:red'>*</span> Title</label>
<?php echo  text_field('pages','title',array('alt'=>'blank','size'=>'60')) ?></p>

<p><label for='pages_status'>Status</label>
<?php
    $_status = $pages->get('status');
    if (!$pages->is_loaded()) {
        $_status = 1;
    }
    echo select_tag('pages[status]',
                     options_for_select(array(1=>'active',0=>'inactive'), $_status)
                     ) 
?></p>

<p><label for='pages_parent_id'>Parent Page</label>
<?php echo  select_tag('pages[parent_id]',
        "<option value='0'>No Parent Page</option>".
            options_for_select($pages->get_pages_as_list($pages->get('id')), 
                              $pages->get('parent_id')),
        array('id'=>'pages_parent_id')) ?></p>
        
<p><label for='pages_template_file'><span style='color:red'>*</span> Template</label>
<?php echo  select_tag('pages[template_file]',
                       options_for_select($pages->get_templates(),
                                         $pages->get('template_file')),
                       array('id'=>'pages_template_file')
                       ); ?>
</p>        

<?php if ($pages->is_loaded()) {?>
<p><label for='pages_index_name'>Page URL</label>
<?php echo  text_field('pages','index_name',array('size'=>'40')) ?></p>
<?php } ?>

<?php 
# only admins or editors may create index page
if (has_access_to('Pages::Lock Pages')) {
?>
<p><label for='pages_is_index'><?php echo  check_box('pages','is_index') ?> Make this page your index (home) page?</label>
    
<span style='font-size:xx-small; color:#666;font-style:italic'><?php 
if ( !empty($current_index_page) && $current_index_page != $pages->get('index_name'))
{
    $current_index_page_text = '<b>NOTE:</b> You currently have a page selected as your index page. 
                           <br />Selecting this option will replace that page with this one as your home page';
}
?></span>
</p><?php } ?>

<p><label for='pages_disable_default_layout'><?php echo  check_box('pages', 'disable_default_layout') ?> Disable the default wrapper layout for this page?</label>
<span style='font-size:xx-small; color:#666;font-style:italic'>If this is checked, when the page is displayed it will not be inside the main "look" of your website. It will only output the template you chose on the left.</span></p>

<?php if ($pages->is_loaded()) { ?>
    <p><label for='pages_restrict_permissions'>
        <?php echo  check_box_tag('pages[restrict_permissions]',
                                  1,
                                  false,
                                  array('id'=>'pages_restrict_permissions')
                                  ) ?> Restrict editing to you only?</label>
    <span style='font-size:xx-small; color:#666;font-style:italic'>If this is checked, only you and any admins will be able to edit this page.</span></p>
<?php } ?>


